<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>教学平台的数据分析系统</title>
<meta name="keywords" content="教学平台的数据分析系统">
<meta name="description" content="教学平台的数据分析系统">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<link rel="stylesheet" href="css/main.css" media="all">
</head>
<body>
	<div class="layui-layout">
		<!-- 头部区域 -->
		<div class="layui-header">
			<ul class="box">
				<li class="header-left"><a href="javascript:;"
					class="btnHeader flexible" title="侧边伸缩"> <i
						class="layui-icon layui-icon-shrink-right"></i>
				</a> <a href="javascript:;" class="btnHeader refresh" title="刷新"> <i
						class="layui-icon layui-icon-refresh-3"></i>
				</a></li>
				<li class="header-right">
<!--				<span class="navHeader">-->
<!--					<div class="layui-nav">-->
<!--						<div class="layui-nav-item">-->
<!--							<a href="javascript:;">-->
<!--								<img src="images/header.png" class="layui-nav-img"><cite><span id="user_name"></span></cite>-->
<!--							</a>-->
<!--						</div>-->
<!--					</div>-->
<!--				</span> -->
<!--				<a href="javascript:;" class="btnHeader logout">安全退出</a></li>-->
			</ul>
		</div>
		<!-- 侧边菜单 -->
		<div class="layui-side">
			<div class="layui-side-scroll">
				<div class="layui-logo" lay-href="html/index.html">
					<img src="images/header.png" style="width: 40px; margin: 10px" /> <span>教学数据分析系统</span>
				</div>
				<ul class="layui-nav layui-nav-tree" lay-filter="nav" id="menus">
					
				</ul>
			</div>
		</div>
		<!-- 主体内容 -->
		<div class="layui-bodier">
			<div class="layui-tab" lay-filter="tab" lay-allowClose="true">
				<ul class="layui-tab-title">
					<li class="firstTab layui-this" lay-id="home1">网站信息</li>
				</ul>
				<div class="layui-tab-content">
					<div class="layui-tab-item layui-show">
						<iframe src="html/info/index.html" frameborder="0" name="tabFrame"
							class="tabFrame"></iframe>
					</div>
				</div>
			</div>
		</div>
		<!-- 版权信息 -->
		<div class="layui-footer">
			<span></span>
		</div>
	</div>
</body>
<script src="js/public.js" charset="utf-8"></script>
<script src="layui/layui.js" charset="utf-8"></script>
<script src="js/common.js"></script>
<script src="js/main.js" charset="utf-8"></script>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.mCustomScrollbar.js"></script>
<script>
	layui.use(['element'], function() {
		var $ = layui.jquery;
		var element = layui.element;
		var user_name = sessionStorage.getItem("user_name");
		var type = sessionStorage.getItem("type");
        $('#user_name').text(user_name);
        var url = "/json/menu1.json";
        // if(type=="1"){
        // 	url='/json/menu1.json';
        // }else if(type=="2"){
        // 	url='/json/menu2.json';
        // }
        $.ajax({
            url:url,
            type:'get',
            dataType:"json",
            data:{},
            async:false,
            beforeSend:function(){
                //console.log(JSON.stringify(data.field));
            },
            success:function(data){
                var funlist = data.data;
                if(funlist != null && funlist.length > 0){
                    var html = '';
                    html += '<li data-name="get" class="layui-nav-item layui-this">' +
                        '<a href="javascript:;" lay-href="pages/index.html" class="nav-tab" lay-id="0"' +
                        'data-type="tabChange" lay-tips="首页">' +
                        '<i class="layui-icon layui-icon-home"></i><label>首页</label>' +
                        '</a></li>';
                    $.each(funlist,function (index,value) {
                        html+= '<li data-name="get" class="layui-nav-item">' +
                            '<a href="javascript:;" lay-href="'+value.url+'" class="nav-tab" lay-id="'+(index+1)+'" lay-tips="'+value.name+'" ';
                            if(value.children == null){
                                html += 'data-type="tabAdd"';
                            }
                            html += '><i class="layui-icon layui-icon-home"></i><label>'+value.name+'</label></a>';
                        if(value.children != null && value.children.length > 0){
                            $.each(value.children,function (idx,val) {
                                html+= '<dl class="layui-nav-child"><dd><a lay-href="'+val.url+'" class="nav-tab" lay-id="'+(index+1)+"_"+idx+'" data-type="tabAdd">' +
                                    '<i class="layui-icon"></i><label>'+val.name+'</label>' +
                                    '</a></dd></dl>';
                            });
                        }
                        html += '</li>';
                    });
                    
                    $('#menus').html(html);
                    element.render();
                }
            },
            error:function(data){
                //do something
                layer.msg('与服务器连接失败',{icon: 2});
            }
        });
        
        
      //滚动条样式
        (function ($) {
            $(window).on("load", function () {
                $(".layui-side-scroll").mCustomScrollbar({
                    theme: "light-3",
                    scrollButtons: {
                        enable: true
                    }
                });
            });
        })(jQuery);
           
	});
</script>

</html>